package com.pioneer.web.sale.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.pioneer.common.core.domain.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * SalContract 销售合同
 *
 * @author hlm
 * @date 2025-04-22 08:57:13
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sal_contract")
public class SalContract extends BaseEntity {

    /**
     * 销售合同ID
     */
    @TableId(type = IdType.AUTO)
    private Long contractId;

    /**
     * 合同编号
     */
    @TableField(condition = SqlCondition.LIKE)
    private String contractCode;

    /**
     * 合同名称
     */
    @NotBlank(message = "合同名称不能为空")
    @TableField(condition = SqlCondition.LIKE)
    private String contractName;

    /**
     * 客户名称
     */
    private String customer;

    /**
     * 合同金额
     */
    private BigDecimal total;

    /**
     * 审批状态
     */
    private String approveStatus;

    /**
     * 审批人
     */
    private String approver;

    /**
     * 审批时间
     */
    private LocalDateTime approveTime;

    /**
     * 审批意见
     */
    private String approveOpinion;

    /**
     * 审批结果
     */
    @TableField(exist = false)
    private String approveResult;

    /**
     * 销售同子表集合
     */
    @TableField(exist = false)
    private List<SalContractBody> contractBodyList;
}
